package cn.dengfanxin.gae.test.keyword;

import java.net.URLEncoder;
import java.util.List;


public class XMLUtil {
	public static String convertKeywordsToXML(List<Keyword> keywords){
		String result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
		result += "<keywords>\n";
		for (Keyword kw : keywords){
			result += "\t<keyword>\n";
			result += "\t <id>" + kw.getId() + "</id>\n";
			result += "\t\t<time>" + kw.getTime() + "</time>\n";
			result += "\t\t<name>" + kw.getKeyword() + "</name>\n";
			result += "\t\t<tag>" + kw.getTag() + "</tag>\n";
			result += "\t\t<level>" + kw.getLevel() + "</level>\n";
			result += "\t</keyword>\n";
		}
		result += "</keywords>\n";
		return result;
		
	}
}
